<?php
/**
 * 用户管理
 * User: cxm
 * Date: 2020/8/16
 * Time: 14:54
 */
namespace Seeds\Admin;

use App\Models\AdminPermission;
class MemberSeeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public static function run()
    {
        // 一级
        $users = AdminPermission::create([
            'pid' => 0, 'sort' => 120, 'http_method' => ['GET'], 'name' => '用户管理', 'fid' => null, 'icon' => 'el-icon-user',
            'http_path' => 'javascript', 'menu_switch' => 2
        ]);

        /** ++++++++++++++++++++++++++++ 用户管理 start ++++++++++++++++++++++++++++++++++*/
        $user_list = AdminPermission::create([
            'pid' => $users->id, 'sort' => 10, 'http_method' => ['GET'], 'name' => '用户列表', 'fid' => null, 'icon' => 'ios-book',
            'url'=>'member_list','http_path' => 'javascript', 'menu_switch' => 2
        ]);
        // 列表
        AdminPermission::create([
            'pid' => $user_list->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '列表', 'fid' => $user_list->id, 'icon' => '',
            'url'=>'','http_path' => '/admin/member/get-lists', 'menu_switch' => 1
        ]);

        // 处理
        AdminPermission::create([
            'pid' => $user_list->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '添加、编辑处理', 'fid' => null, 'icon' => '',
            'url'=>'','http_path' => '/admin/member/store', 'menu_switch' => 1
        ]);

        // 删除
        AdminPermission::create([
            'pid' => $user_list->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '删除', 'fid' => null, 'icon' => '',
            'url'=>'','http_path' => '/admin/member/delete', 'menu_switch' => 1
        ]);

        // 修改会员状态
        AdminPermission::create([
            'pid' => $user_list->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '修改状态', 'fid' => null, 'icon' => '',
            'url'=>'','http_path' => '/admin/member/updateStatus', 'menu_switch' => 1
        ]);

        // 导出
        AdminPermission::create([
            'pid' => $user_list->id, 'sort' => 10, 'http_method' => ['POST'], 'name' => '导出', 'fid' => null, 'icon' => '',
            'url'=>'','http_path' => '/admin/member/export', 'menu_switch' => 1
        ]);

        // 导入
        AdminPermission::create([
            'pid' => $user_list->id, 'sort' =>20, 'http_method' => ['POST'], 'name' => '导入', 'fid' => null, 'icon' => '',
            'http_path' => '/admin/member/import', 'menu_switch' => 1
        ]);

        // 查看处理的数据
        AdminPermission::create([
            'pid' => $user_list->id, 'sort' =>20, 'http_method' => ['POST'], 'name' => '查看处理的数据-导入', 'fid' => null, 'icon' => '',
            'http_path' => '/admin/member/showData', 'menu_switch' => 1
        ]);

        // 删除导入记录
        AdminPermission::create([
            'pid' => $user_list->id, 'sort' =>20, 'http_method' => ['POST'], 'name' => '删除导入记录', 'fid' => null, 'icon' => '',
            'http_path' => '/admin/member/importRecordDelete', 'menu_switch' => 1
        ]);

        // 错误记录
        AdminPermission::create([
            'pid' => $user_list->id, 'sort' =>20, 'http_method' => ['POST'], 'name' => '错误记录', 'fid' => null, 'icon' => '',
            'http_path' => '/admin/member/showErrorLog', 'menu_switch' => 1
        ]);

        // 错误记录-导出
        AdminPermission::create([
            'pid' => $user_list->id, 'sort' =>20, 'http_method' => ['POST'], 'name' => '错误记录-导出', 'fid' => null, 'icon' => '',
            'http_path' => '/admin/member/showErrorLogExport', 'menu_switch' => 1
        ]);

        /** ++++++++++++++++++++++++++++ 用户管理 end ++++++++++++++++++++++++++++++++++*/


    }
}